﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ComboBox.aspx.cs" Inherits="demo.Pages.ComboBox" %>

<%@ Register Assembly="Water" Namespace="Water.Web.Controls" TagPrefix="page" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <fieldset>
            <legend>ComboBox</legend>
            <ul>
                <li>ComboBox继承于Autocomplete,拥有所有Autocomplete的特点</li>
                <li>在使用时一次性加载数据，提高了加载速度和性能</li>
            </ul>
        </fieldset>
        <br />
        <page:Container ID="Container1" runat="server" TitleText="ComboBox">
        <ItemTemplate>
            <page:ComboBox ID="Autocomplete1" runat="server" 
            TypeName="demo.Objects.BLL.Regions" 
            ReturnTextField="REGIONNAME" 
            ReturnValueField="REGIONID" 
            MatchField="REGIONNAME" 
            Prompt="区域">
            </page:ComboBox>
            <page:ComboBox ID="Autocomplete2" runat="server" 
            TypeName="demo.Objects.BLL.Countries" 
            ReturnTextField="countryname" 
            ReturnValueField="countryid" 
            MatchField="COUNTRYNAME" 
            Prompt="国家" 
            SelectWidth="300" 
            Max="30">
            </page:ComboBox>
            <page:ComboBox ID="Autocomplete3" runat="server" 
            TypeName="demo.Objects.BLL.Departments" 
            ReturnTextField="departmentName"
            ReturnValueField="departmentId" 
            MatchField="departmentName" 
            Prompt="部门" 
            SelectWidth="300" Max="100">
            </page:ComboBox>
            <page:ComboBox ID="Autocomplete4" runat="server" 
            TypeName="demo.Objects.BLL.Jobs" 
            ReturnTextField="title" 
            ReturnValueField="jobId" 
            MatchField="title" 
            Prompt="岗位(自定义显示格式)" 
            SelectWidth="400" 
            SelectHeight="300"
            Max="100"
           FormatItem="function aa(row,i,max) { return '<td>'+row.TITLE+'</td><td>'+row.JOBID+'</td><td>'+row.MINSALARY+'</td><td>'+row.MAXSALARY+'</td>';}">
           </page:ComboBox>
            <page:ComboBox ID="Autocomplete5" runat="server" 
            TypeName="demo.Objects.BLL.Employees" 
            ReturnTextField="NAME" 
            ReturnValueField="PROMPT" 
            MatchField="NAME" 
            Prompt="员工属性(指定方法)" 
            SelectWidth="400" 
            Max="100" 
            MethodName="GetSelf" >
            </page:ComboBox>
        </ItemTemplate>
        </page:Container>
    </div>
    </form>
</body>
</html>
